package com.zp.factory;

import com.zp.entity.*;

/**
 * @author zhpeng
 * @discription
 * @created 2021/9/3 12:49
 */
public class GeometryFactory {
    public Geometry getGeometry(String type){
        if("".equals(type) || type == null){
            return null;
        }
        if("circle".equals(type)){
            return new Circle();
        }else if("square".equals(type)){
            return new Square();
        }else if("triangle".equals(type)){
            return new Triangle();
        }
        return null;
    }
}
